Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Renamed updateContainerDimensionsDuringDrag to updateContainerDimensionsDuringMove to reflect broader usage
  • Added handling for position changes in onNodesChange to resize containers when child nodes are moved via keyboard arrows
  • Containers now stay properly sized when nodes inside them are moved with keyboard navigation

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 28, 2026 8:21pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Greptile Overview

Greptile Summary

This PR fixes a bug where containers weren't properly resizing when child nodes were moved using keyboard navigation. The fix renames updateContainerDimensionsDuringDrag to updateContainerDimensionsDuringMove and adds handling in onNodesChange for position changes from keyboard movements.

Key changes:

  • Added !change.dragging check in onNodesChange to handle keyboard movements while avoiding duplicate calls during mouse drag operations
  • Function rename reflects its broader usage for both drag and keyboard movement scenarios
  • Previous thread concern about duplicate calls has been properly addressed

The implementation is clean and follows the existing patterns in the codebase.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is well-scoped, addresses a specific bug, and properly handles the edge case identified in previous review feedback. The !change.dragging check correctly prevents duplicate function calls during drag operations while enabling the desired keyboard movement behavior.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Renamed function to reflect broader usage and added keyboard movement handling with proper drag detection to avoid duplicate calls

Sequence Diagram

sequenceDiagram
    participant User
    participant ReactFlow
    participant onNodesChange
    participant onNodeDrag
    participant updateContainerDimensionsDuringMove
    participant DisplayNodes

    Note over User,DisplayNodes: Keyboard Movement Scenario
    User->>ReactFlow: Press arrow key to move node
    ReactFlow->>onNodesChange: NodeChange (type: position, dragging: false)
    onNodesChange->>onNodesChange: Apply node changes
    onNodesChange->>onNodesChange: Check if position change && !dragging
    onNodesChange->>updateContainerDimensionsDuringMove: Update container with new position
    updateContainerDimensionsDuringMove->>DisplayNodes: Resize container to fit children

    Note over User,DisplayNodes: Mouse Drag Scenario
    User->>ReactFlow: Drag node with mouse
    ReactFlow->>onNodeDrag: Node drag event
    onNodeDrag->>onNodeDrag: Check if node has parent container
    onNodeDrag->>updateContainerDimensionsDuringMove: Update container with drag position
    updateContainerDimensionsDuringMove->>DisplayNodes: Resize container during drag
    ReactFlow->>onNodesChange: NodeChange (type: position, dragging: true)
    onNodesChange->>onNodesChange: Apply node changes
    onNodesChange->>onNodesChange: Check if position change && !dragging (false, skip)
    Note over onNodesChange,updateContainerDimensionsDuringMove: Duplicate call prevented by !dragging check
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

Add !change.dragging check to only handle keyboard movements in
onNodesChange, since mouse drags are already handled by onNodeDrag.
@waleedlatif1 waleedlatif1 force-pushed the fix/keyboard-subflow-movement branch from 81cd857 to 7c0952d Compare January 28, 2026 18:39
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Keyboard arrow key movements now call collaborativeBatchUpdatePositions
to sync position changes to the backend for persistence and real-time
collaboration.
@waleedlatif1 waleedlatif1 force-pushed the fix/keyboard-subflow-movement branch from f97021f to 5e9d9d5 Compare January 28, 2026 20:02
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

…Ds (#3044)

* improvement(cmdk): refactor search modal to use cmdk + fix icon SVG IDs

* chore: remove unrelated workflow.tsx changes

* chore: remove comments

* chore: add devtools middleware to search modal store

* fix: allow search data re-initialization when permissions change

* fix: include keywords in search filter + show service name in tool operations

* fix: correct filterBlocks type signature

* fix: move generic to function parameter position

* fix(mcp): correct event handler type for onInput

* perf: always render command palette for instant opening

* fix: clear search input when modal reopens
…atibility (#3046)

* fix(helm): move rotationPolicy under privateKey for cert-manager compatibility

* docs(helm): add reclaimPolicy Retain guidance for production database storage

* fix(helm): prevent empty branding ConfigMap creation
Check isInDragOperation before persisting in onNodesChange to prevent
duplicate calls. Drag-end events have dragStartPosition still set,
while keyboard movements don't, allowing proper distinction.
@waleedlatif1 waleedlatif1 force-pushed the fix/keyboard-subflow-movement branch from 3f8b1a7 to f9c793d Compare January 28, 2026 20:19
@waleedlatif1 waleedlatif1 merged commit 2c2b485 into staging Jan 28, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/keyboard-subflow-movement branch January 28, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants